home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AniCharactersMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  6.0 KB  |  208 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //    MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //    Creation Date:  15 October 1998
  22. //    Author:         mt
  23. //
  24. //  Procedure Name:
  25. //      AniCharactersMenu
  26. //
  27. //  Description:
  28. //        Create the character menu
  29. //
  30. //  Input Arguments:
  31. //      parent to parent the menu to
  32. //
  33. //  Return Value:
  34. //      None.
  35. //
  36.  
  37.  
  38. global proc AniCharactersMenu( string $parent )
  39. {
  40.     setParent -m $parent;
  41.     if( `menu -q -ni $parent` != 0 ) {
  42.         //
  43.         //    Menu is built already - just return
  44.         //
  45.         return;
  46.     }
  47.  
  48.     menuItem -l "Create Character Set" 
  49.         -annotation "Create Character Set: Attributes on the selected objects will be placed in a character set"
  50.         -c "CreateCharacter" 
  51.         -dragMenuCommand "performCreateCharacter 2" 
  52.         createCharacterItem;
  53.         menuItem -optionBox true
  54.             -annotation "Create Character Set Option Box"
  55.             -l "Create Character Set Option Box"
  56.             -c "CreateCharacterOptions"
  57.             createCharacterDialogItem; 
  58.     menuItem -l "Create Subcharacter Set"
  59.         -annotation "Create Subcharacter Set: Make highlighted channel box items a subcharacter of the current character"        
  60.         -c "performCreateSubcharacter 0"
  61.         -dragMenuCommand "performCreateSubcharacter 2"
  62.         createSubCharacterItem;
  63.         menuItem -optionBox true
  64.             -annotation "Create Subcharacter Set Option Box"
  65.             -l "Create Subcharacter Set Option Box"
  66.             -c "performCreateSubcharacter 1"
  67.             createSubCharacterDialogItem; 
  68.  
  69.     menuItem -l "Attribute Editor..."
  70.         -annotation "Attribute Editor: Edit values of attributes in the character set"
  71.         -command "EditCharacterAttributes" 
  72.         editCharacterAttributesItem;
  73.  
  74.     menuItem -d true;
  75.  
  76.     menuItem -l "Add to Character Set"
  77.         -annotation "Add to Character Set: Add highlighted channel box items to current character set"
  78.         -c "doEditCharacterArgList 1 { \"1\" }"
  79.         addCharacterItem;
  80.     menuItem -l "Remove from Character Set"
  81.         -annotation "Remove from Character Set: Remove highlighted channel box items from current character set"        
  82.         -c "doEditCharacterArgList 1 { \"0\" }"
  83.         removeCharacterItem;
  84.     menuItem -l "Merge Character Sets"
  85.         -annotation "Merge Character Sets: Combine the selected characters into a single character set"        
  86.         -c "mergeCharacters"
  87.         mergeCharacterItem;
  88.     
  89.     menuItem -divider true;
  90.  
  91.  
  92.     menuItem -l "Select Character Set Node" -sm true -aob true
  93.         selectCharSMItem;
  94.     menu -e -pmc "createSelectCharMenu selectCharSMItem" 
  95.         selectCharSMItem;
  96.     setParent -m ..;
  97.     menuItem -l "Select Character Set Members" -sm true -aob true
  98.         selectCharNodesSMItem;
  99.     menu -e -pmc "createSelectCharNodesMenu selectCharNodesSMItem" 
  100.         selectCharNodesSMItem;
  101.     setParent -m ..;
  102.     menuItem -l "Set Current Character Set" -sm true setCharSMItem;
  103.     menu -e -pmc "buildSetCharacterMenu setCharSMItem" setCharSMItem;
  104.     setParent -m ..;
  105.  
  106.     setParent -m ..;
  107. }
  108.  
  109. //
  110. //  Procedure Name:
  111. //      selectNodesInCharacter
  112. //
  113. //  Description:
  114. //        Select all of the nodes in a particular character.  Note that
  115. //      this method adds to the selection, and does not replace it.  Do
  116. //      a "select -cl" before calling this method if you wish to replace
  117. //      the current selection.
  118. //
  119. //  Input Arguments:
  120. //      $character - character who's nodes we are to select
  121. //
  122. //  Return Value:
  123. //      None
  124. //
  125. global proc selectNodesInCharacter( string $character ) 
  126. {
  127.     string $list[] = `sets -nodesOnly -query $character`;
  128.     for ( $item in $list ) {
  129.         if ( "character" == `nodeType $item` ) {
  130.             selectNodesInCharacter( $item );
  131.         } else {
  132.             select -add $item;
  133.         }
  134.     }
  135. }
  136.  
  137. //
  138. //  Procedure Name:
  139. //      createSelectCharNodesMenu
  140. //
  141. //  Description:
  142. //        Create the menu for selecting all of the nodes in
  143. //      a particular character.
  144. //
  145. //  Input Arguments:
  146. //      $parent - parent menu
  147. //
  148. //  Return Value:
  149. //      None
  150. //
  151. global proc createSelectCharNodesMenu( string $parent ) {
  152.     setParent -m $parent;
  153.     menu -e -dai $parent;
  154.  
  155.     //    Get characters in system
  156.     //
  157.     string $characters[] = `ls -type character`;
  158.  
  159.     if( `size $characters` == 0 ) {
  160.         menuItem -l "No Character Sets Defined" -enable false;
  161.     } else {
  162.         string $cmd;
  163.         string $annotation;
  164.         for( $character in $characters ) {
  165.             $cmd = ( "select -cl;selectNodesInCharacter( \"" + $character + "\" )" );
  166.             $annotation = ( "Select all of the nodes that are a part of " + 
  167.                 $character );
  168.             menuItem -l $character -c $cmd -annotation $annotation;
  169.         }
  170.     }
  171. }
  172.  
  173. //
  174. //  Procedure Name:
  175. //      createSelectCharMenu
  176. //
  177. //  Description:
  178. //        Create the menu for selecting characters quickly
  179. //
  180. //  Input Arguments:
  181. //      $parent - parent menu
  182. //
  183. //  Return Value:
  184. //      None
  185. //
  186. global proc createSelectCharMenu( string $parent ) {
  187.     setParent -m $parent;
  188.     menu -e -dai $parent;
  189.  
  190.     //    Get characters in system
  191.     //
  192.     string $characters[] = `ls -type character`;
  193.  
  194.     if( `size $characters` == 0 ) {
  195.         menuItem -l "No Character Sets Defined" -enable false;
  196.     } else {
  197.         string $cmd;
  198.         string $annotation;
  199.         for( $character in $characters ) {
  200.             $cmd = ( "select -r \"" + $character + "\"" );
  201.             $annotation = ( "Select " + $character );
  202.             menuItem -l $character -c $cmd -annotation $annotation;
  203.         }
  204.     }
  205. }
  206.  
  207.  
  208.